package com.rw.bootdemo.config;

import com.rw.bootdemo.pojo.Tuser;
import com.rw.bootdemo.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
public class TestConfigure {

    @Bean
    public User user(){
        User u = new User();
        u.setPwd("123456");
        u.setUid(12);
        u.setUname("TestComponent-getUser");
        return u;
    }
//    @Bean("user2")
//    public User getUser2(){
//        User u = new User();
//        u.setPwd("987654");
//        u.setUid(123);
//        u.setUname("TestComponent-getUser2");
//        return u;
//    }

    @Bean
    public Tuser tuser(){
        Tuser t = new Tuser();
        t.setId(123);
        t.setUser(user());
        return t;
    }
}
